package com.easy.dfc.service;

import com.easy.dfc.Utils.PagingUtil;
import com.easy.dfc.mapper.OrderItemSetMapper;
import com.easy.dfc.mapper.OrderSetMapper;
import com.easy.dfc.entity.OrderItemSetWithBLOBs;
import com.easy.dfc.entity.OrderSetWithBLOBs;
import com.easy.dfc.entity.OrderStatusNum;
import com.easy.dfc.entity.Userset;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by VULCANTSeries on 2017/6/2.
 */
@Service
public class OrderSetService {

    @Resource
    private OrderSetMapper orderSetMapper;

    @Resource
    private OrderItemSetMapper orderItemSetMapper;

    public OrderSetWithBLOBs selectById(int Id) {
        return orderSetMapper.selectByPrimaryKey(Id);
    }

    public List<OrderSetWithBLOBs> selectByFactoryId(PagingUtil pagingUtil) {
        return orderSetMapper.selectByFactoryId(pagingUtil);
    }

    public List<OrderSetWithBLOBs> selectByDealerId(PagingUtil pagingUtil) {
        return orderSetMapper.selectByDealerId(pagingUtil);
    }

    public List<OrderItemSetWithBLOBs> selectByOrderSetId(int orderId) {
        return orderItemSetMapper.selectByOrderSetId(orderId);
    }

    public int insertSelective(OrderItemSetWithBLOBs orderItemSetWithBLOBs) {
        return orderItemSetMapper.insertSelective(orderItemSetWithBLOBs);
    }

    public List<OrderStatusNum> selectStatusNumByFactory(String userId) {
        return orderSetMapper.selectStatusNumByFactory(userId);
    }

    public List<OrderStatusNum> selectStatusNumByDealer(String userId) {
        return orderSetMapper.selectStatusNumByDealer(userId);
    }

    public Userset selectUser(int id) {
        return orderSetMapper.selectUser(id);
    }

    public Userset selectUserByFactory(int id) {
        return orderSetMapper.selectUserByFactory(id);
    }

    public int updateByPrimaryKeySelective(OrderSetWithBLOBs orderSetWithBLOBs) {
        return orderSetMapper.updateByPrimaryKeySelective(orderSetWithBLOBs);
    }

    public int insertSelective(OrderSetWithBLOBs orderSetWithBLOBs) {
        return orderSetMapper.insertSelective(orderSetWithBLOBs);
    }

    public OrderSetWithBLOBs selectItemNo(String itemNo) {
        return orderSetMapper.selectItemNo(itemNo);
    }
}
